home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / Box.java < prev    next >
Text File  |  1998-09-15  |  403b  |  26 lines

  1.  
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5.  
  6. public class Box extends Component
  7. {
  8.   Box(Color c)
  9.   {
  10.     setForeground(c);
  11.   }
  12.  
  13.   public void paint(Graphics g)
  14.   {
  15.     super.paint(g);
  16.     g.setColor(getForeground());
  17.     g.fill3DRect(0, 0, getSize().width-1, getSize().height-1, true);
  18.   }
  19.   
  20.   public Dimension getPreferredSize()
  21.   {
  22.     return new Dimension(64, 16);
  23.   }
  24. }
  25.  
  26.